package com.com.itext.day2;

import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;

import java.io.FileNotFoundException;

public class demo5 {
    public static void main(String[] args) {
        try {
            PdfDocument document = new PdfDocument(new PdfWriter("D:\\测试pdf\\day1_5.pdf"));
            PageSize size = PageSize.A4.rotate();
            PdfPage page = document.addNewPage(size);
            PdfCanvas canvas = new PdfCanvas(page);
            //canvas.moveTo(-406,0).lineTo(406,0).stroke();
            canvas.concatMatrix(1,0,0,1,size.getWidth()/2,size.getHeight()/2);
            document.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
